This script is a tool for programmers who wish to create a STR# resource from a text file.
Requirements
The software required to use this script is AppleScript (1.0 or higher), a resource editor (any version of ResEdit or Resourcer) a data fork editor (e.g. HexEdit 1.0.7 by Jim Bumgardner), and a word processor or text editor (e.g. SimpleText 1.4).
Operation
Before using the 'Text to STR#' script, you will need to use your word processor/text editor to convert the text file to the following format: Standard Mac text, hard returns between each string, no hard return after the last string in the file. For example, if we want the first string in the STR# resource to be 'abc', the second 'def' and the third 'ghi', the text file would look like this:
You can run the script by double-clicking on it and selecting the text file in the resulting file selection dialog, or you can drag the file onto the script icon. You will then be prompted for a name and location for the resulting STR# data file.
The script will quit when the process of creating the STR# data file is complete (typically a few seconds).
Open the resource file that you want the STR# resource to appear in with a resource editor. Create the STR# resource, and open the resource in hex editing mode. In ResEdit, this is achieved via the Open Using Hex Editor command in the Resource menu. In Resourcer, ensure that the STR# resource is selected and click on the Hex button.
Open the STR# data file with a data fork editor. If the data fork editor has an option to display high order ASCII, ensure that this option is on. Click in the column that displays the hex data as characters (normally the right most column). Select all (command-A) and copy (command-C).
Switch to the resource editor window that displays the STR# resource in hex format. Click in the column that displays the hex data as characters (the right most column). Select all (command-A) and paste (command-P). If you get a message that the clipboard data must be in hex format, you may have selected the wrong column in a previous step, or your data fork editor may not by copying the text to the clipboard correctly.
Close the hex editing window in the resource editor, then open the STR# resource in the normal manner to ensure that the data is correct.
Contact Information
If you should have any problems with this script, or find a bug, please write to me. I can be contacted at: